package com.senlingspace.system.mapper;

import java.util.List;

import com.senlingspace.system.domain.SlkjShopProduct;
import com.senlingspace.system.domain.vo.ProductResponse;
import org.apache.ibatis.annotations.Param;

/**
 * 门店商品状态Mapper接口
 *
 * @author SenlingSpace
 * @date 2024-07-30
 */
public interface SlkjShopProductMapper {

    /**
     * 查询门店 上架状态的商品列表
     */
    List<ProductResponse> queryProductsByShopAndName(@Param("shopId") Long shopId,
                                                     @Param("productName") String productName,
                                                     @Param("productTpyeId") Long productTpyeId,
                                                     @Param("productId") Long productId
    );


    /**
     * 查询门店商品状态
     *
     * @param id 门店商品状态主键
     * @return 门店商品状态
     */
    public SlkjShopProduct selectSlkjShopProductById(Long id);

    /**
     * 查询门店商品状态列表
     *
     * @param slkjShopProduct 门店商品状态
     * @return 门店商品状态集合
     */
    public List<SlkjShopProduct> selectSlkjShopProductList(SlkjShopProduct slkjShopProduct);

    /**
     * 新增门店商品状态
     *
     * @param slkjShopProduct 门店商品状态
     * @return 结果
     */
    public int insertSlkjShopProduct(SlkjShopProduct slkjShopProduct);

    /**
     * 修改门店商品状态
     *
     * @param slkjShopProduct 门店商品状态
     * @return 结果
     */
    public int updateSlkjShopProduct(SlkjShopProduct slkjShopProduct);

    /**
     * 删除门店商品状态
     *
     * @param id 门店商品状态主键
     * @return 结果
     */
    public int deleteSlkjShopProductById(Long id);

    /**
     * 批量删除门店商品状态
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSlkjShopProductByIds(Long[] ids);

    int selectShopProductByProId(@Param("shopId") Long shopId, @Param("productId") Long productId);

    int deleteShopProductByPorductIdShopId(@Param("shopId") Long shopId, @Param("productId") Long productId);

    /**
     * 根据商品id查询商品信息
     *
     * @param productIds
     * @return {@link List }<{@link SlkjShopProduct }>
     */
    List<SlkjShopProduct> selectShopProductListByProductIds(@Param("productIds") List<Long> productIds);


    /**
     * 根据店铺id查询商品类型
     *
     * @param shopId
     * @return {@link List }<{@link ProductResponse }>
     */
    List<ProductResponse> getProductTypesByShopId(Long shopId);

    /**
     * 查询小程序商品类型
     *
     * @return {@link List }<{@link ProductResponse }>
     */
    List<ProductResponse> getWxProductTypes();

    /**
     * 查询小程序商品列表
     *
     * @param productName
     * @param productTpyeId
     * @param productId
     * @return {@link List }<{@link ProductResponse }>
     */
    List<ProductResponse> getWxProductsByShopAndName(@Param("productName") String productName,
                                                     @Param("productTpyeId") Long productTpyeId,
                                                     @Param("productId") Long productId);

}
